import { RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/:pathMatch(.*)*",
    component: () => import("@renderer/views/404.vue"),
  },
  {
    path: "/",
    name: "parentView",
    redirect: "/recentlyEdited",
    component: () => import("@renderer/views/parentView.vue"),
    children: [
      {
        path: "/recentlyEdited",
        name: "recentlyEdited",
        component: () => import("@renderer/views/recentlyEdited.vue"),
        meta: {
          title: "最近编辑",
        },
      },
      {
        path: "/myProject",
        name: "myProject",
        component: () => import("@renderer/views/myProject.vue"),
        meta: {
          title: "我的项目",
        },
      },
      {
        path: "/templateMarket",
        name: "templateMarket",
        component: () => import("@renderer/views/templateMarket.vue"),
        meta: {
          title: "模版资源",
        },
      },
      {
        path: "/dataSource",
        name: "dataSource",
        component: () => import("@renderer/views/dataSource.vue"),
        meta: {
          title: "数据源管理",
        },
      },
    ],
  },

  {
    path: "/editContainer",
    name: "editContainer",
    component: () => import("@renderer/views/editContainer.vue"),
  },
  {
    path: "/preview",
    name: "preview",
    component: () => import("@renderer/views/Preview.vue"),
  },
  {
    path: "/previewOutLine",
    name: "previewOutLine",
    component: () => import("@renderer/views/PreviewOutLine.vue"),
  },
];

export default routes;
